<template>
	<view class="">
		<view class="top">
			长按保存到手机
		</view>
		<image :src="'http://wechatdev.midaihz.com/api/wechat/invite/placard/'+inviteCode" mode="" class="create-img" :style="{height:canvasHeight+'px',width:canvasWidth+'px'}"></image>
	<!-- 	<view  v-else class="share-box" :style="{height:canvasHeight+'px',width:canvasWidth+'px'}">
		<image src="../../static/image/share_3.png" mode="" class="share-logo"></image>
		<image src="../../static/image/share_4.png" mode="" class="share-leaf"></image>
		<image :src="canInfo.image" mode="" class="share-intrduce"></image>
		<image src="../../static/image/share_2.png" mode="" class="share-footer"></image>
		<view class="wx-code">
			<image :src="info.qrUrl" mode=""></image>
		</view>
		<view class="name">
			{{info.fullName}} 　邀请您扫码加入
		</view>
		<view class="date">
			二维码有效期至：{{info.expDate}}
		</view>
	</view> -->
	</view>
</template>

<script>
	import api from '../../api/index.js'
	export default {
		data() {
			return {
				info: {},
				canInfo: {},
				canvasHeight: '',
				canvasWidth: '',
				inviteCode:''
				
			}
		},
		onLoad(opt) {
			this.getCanJoinPlan()

			const {
				windowWidth,
				windowHeight
			} = uni.getSystemInfoSync();
			this.canvasWidth = windowWidth
			this.canvasHeight = windowHeight


		},
		methods: {

			// 获取可加入的互助计划
			getCanJoinPlan() {
				api.joinHellp.getCanJoinPlan().then(res => {
					if (res.code == 1) {
						this.canInfo = res.data[0]
						this.getInfo()
					}
				})
			},
			// 获取用户信息
			getInfo(image) {

				api.wxAuth.invite().then(res => {
					if (res.code == 1) {
						this.info = res.data
						this.inviteCode = res.data.inviteCode
		


					}
				})
			},
		}
	}
</script>

<style>
	@import "../../static/css/common.css";



	.top {
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		z-index: 200000;
		height: 70rpx;
		background: rgba(0,0,0,0.3);
		line-height: 70rpx;
		text-align: center;
		color: #fff;
		font-size: 28rpx;
	}

	uni-canvas>canvas {
		bottom: 0 !important;
	}

	.share-box {
		background: #E4FFE1;
		height: 100%;
	}

	.share-logo {
		width: 234rpx;
		height: 73rpx;
		position: absolute;
		left: 30rpx;
		top: 30rpx;
	}

	.share-leaf {
		width: 273rpx;
		height: 176rpx;
		position: absolute;
		right: 0;
		top: 0;
	}

	.share-intrduce {
		width: 544rpx;
		height: 207rpx;
		margin-top: 220rpx;
		margin-left: 104rpx;
	}

	.share-footer {
		position: absolute;
		right: 0;
		left: 0;
		bottom: 0;
		width: 100%;
		height: 179rpx;
	}

	.wx-code {
		width: 420rpx;
		height: 420rpx;
		background: #fff;
		margin: 40rpx auto 20rpx auto;
	}

	.wx-code image {
		width: 100%;
		height: 100%;
	}

	.name {
		margin-bottom: 10rpx;
	}

	.name,
	.date {
		font-size: 20rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #333;
		text-align: center;
	}
</style>
